package com.kefu.chat.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.kefu.chat.model.ChatChannel;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractInsertVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "渠道配置")
public class ChatChannelInsertVo extends AbstractInsertVo<ChatChannel> {
    @ApiModelProperty(name = "channelType", value = "渠道类型：1桌面网站，2移动网站，3APP，4微信，5小程序，6企业微信")
    private Integer channelType;

    @ApiModelProperty(name = "channelName", value = "渠道名称")
    private String channelName;

    @ApiModelProperty(name = "inviteMode", value = "主动邀请：0关闭，1开启")
    private Integer inviteMode;

    @ApiModelProperty(name = "travelMode", value = "浏览轨迹：0关闭，1开启")
    private Integer travelMode;

    @ApiModelProperty(name = "receiveMode", value = "接待模式：0机器人优先，1人工优先，2仅机器人，3仅人工")
    private Integer receiveMode;

    @ApiModelProperty(name = "robotNo", value = "机器人")
    private Integer robotNo;

    @ApiModelProperty(name = "groupMode", value = "分组接待：0关闭，1开启")
    private Integer groupMode;

    @ApiModelProperty(value = "分组接待样式：1=文本样式，2=图文样式，3=图文+描述样式")
    private Integer groupStyle;

    @ApiModelProperty(value = "分组接待引导文案")
    private String groupGuideMsg;

    @ApiModelProperty(value = "技能组设置，json格式")
    private String groupConfig;

    @ApiModelProperty(name = "keywordMode", value = "关键词转人工：0关闭，1开启")
    private Integer keywordMode;

    @ApiModelProperty(value = "排队策略： default,vip")
    private String queueMode;

    @ApiModelProperty(value = "vip 优先时间,分钟")
    private Integer vipTime;

    @ApiModelProperty(name = "robotEvaluate", value = "机器人回答顶踩：0关闭，1开启")
    private Integer robotEvaluate;

    @ApiModelProperty(value = "机器人回答点'踩'是否转人工：0关闭，1开启")
    private Integer robotEvaluateTransferUserMode;

    @ApiModelProperty(name = "noticeMode", value = "通告消息：0关闭，1开启")
    private Integer noticeMode;

    @ApiModelProperty(value = "通告背景颜色")
    private String noticeBgColor;

    @ApiModelProperty(value = "通告文字颜色")
    private String noticeTextColor;

    @ApiModelProperty(name = "noticeMsg", value = "通告消息")
    private String noticeMsg;

    @ApiModelProperty(name = "robotWelcomeMode", value = "机器人欢迎语：0关闭，1开启")
    private Integer robotWelcomeMode;

    @ApiModelProperty(name = "robotWelcomeMsg", value = "机器人欢迎语")
    private String robotWelcomeMsg;

    @ApiModelProperty(name = "adminWelcomeMode", value = "客服欢迎语：0关闭，1开启")
    private Integer adminWelcomeMode;

    @ApiModelProperty(name = "adminWelcomeMsg", value = "客服欢迎语")
    private String adminWelcomeMsg;

    @ApiModelProperty(name = "robotUnknownMsg", value = "机器人未知回答")
    private String robotUnknownMsg;

    @ApiModelProperty(name = "adminOfflineMode", value = "客服不在线说辞：0关闭，1开启")
    private Integer adminOfflineMode;

    @ApiModelProperty(name = "adminOfflineMsg", value = "客服不在线说辞")
    private String adminOfflineMsg;

    @ApiModelProperty(name = "userQueueMode", value = "用户排队说辞：0关闭，1开启")
    private Integer userQueueMode;

    @ApiModelProperty(name = "userQueueMsg", value = "用户排队说辞")
    private String userQueueMsg;

    @ApiModelProperty(name = "adminCloseMode", value = "客服结束会话说辞：0关闭，1开启")
    private Integer adminCloseMode;

    @ApiModelProperty(name = "adminCloseMsg", value = "客服结束会话说辞")
    private String adminCloseMsg;

    @ApiModelProperty(name="unWorkingMsg",value = "非工作时间")
    private String unWorkingMsg;

    @ApiModelProperty(name = "adminTimeoutMode", value = "客服超时提示：0关闭，1开启")
    private Integer adminTimeoutMode;

    @ApiModelProperty(name = "adminTimeoutMsg", value = "客服超时提示")
    private String adminTimeoutMsg;

    @ApiModelProperty(name = "adminTimeoutTime", value = "客服超时提示分钟数")
    private Integer adminTimeoutTime;

    @ApiModelProperty(name = "userTimeoutMode", value = "用户超时提示：0关闭，1开启")
    private Integer userTimeoutMode;

    @ApiModelProperty(name = "userTimeoutMsg", value = "用户超时提示")
    private String userTimeoutMsg;

    @ApiModelProperty(name = "userTimeoutTime", value = "用户超时提示分钟数")
    private Integer userTimeoutTime;

    @ApiModelProperty(name = "userOverTime", value = "用户超时下线分钟数")
    private Integer userOverTime;

    @ApiModelProperty(name = "userOverMsg", value = "用户超时下线")
    private String userOverMsg;

    @ApiModelProperty(name = "kitIcon", value = "套件图标，0-5")
    private Integer kitIcon;

    @ApiModelProperty(name = "kitPosition", value = "套件位置，0右下，1左下")
    private Integer kitPosition;

    @ApiModelProperty(name = "kitMarginx", value = "套件侧边距")
    private Integer kitMarginx;

    @ApiModelProperty(name = "kitMarginy", value = "套件下边距")
    private Integer kitMarginy;

    @ApiModelProperty(name = "kitBgcolor", value = "背景颜色")
    private String kitBgcolor;

    @ApiModelProperty(name = "kitTxcolor", value = "文字颜色")
    private String kitTxcolor;

    @ApiModelProperty(value = "满意度评价开关：0关闭，1开启")
    private Integer evaluateMode;

    @ApiModelProperty(value = "工单留言开关：0关闭，1开启")
    private Integer workorderMode;

    @ApiModelProperty(value = "窗口标题文案")
    private String titleDesc;

    @ApiModelProperty(value = "询前表单开关：0关闭，1开启")
    private Integer userFormMode;

    @ApiModelProperty(value = "询前表单设置，json格式")
    private String userFormConfig;

    @ApiModelProperty(value = "熟客指定分配，0关闭，1开启")
    private Integer chooseLastAdminMode;

    @ApiModelProperty(value = "机器人提示：0关闭，1开启")
    private Integer robotTipMode;

    @ApiModelProperty(value = "语音视频聊天开关 0=关闭，1=开启")
    private Integer videoFlag;

    @ApiModelProperty(value = "套件宽度")
    private Integer kitWidth;

    @ApiModelProperty(value = "窗口宽度")
    private Integer winWidth;

    @ApiModelProperty(value = "留言开关：0关闭，1开启")
    private Integer leaveMsgMode;

    @ApiModelProperty(value = "留言方式：1留言纪录，2转工单")
    private Integer leaveMsgType;

    @ApiModelProperty(value = "留言转工单工单类型")
    private String leaveMsgWoType;

    @ApiModelProperty(value = "转人工按钮显示：0关闭，1开启")
    private Integer transferUserMode;

    @ApiModelProperty(value = "是否开启常见问题 0=否，1=是")
    private Integer faqMode;
    @ApiModelProperty(name = "faqId", value = "常见问题方案id")
    private String faqId;

    @ApiModelProperty(value = "是否开启会话快捷菜单0=否，1=是")
    private Integer menuMode;
    @ApiModelProperty(value = "快捷菜单方案id", name = "menuConfigPlanId")
    private String menuConfigPlanId;

    @ApiModelProperty(value = "机器人直接回答转人工：0不转人工，1显示转人工按钮")
    private Integer robotAnswerTransferUserMode;

    @ApiModelProperty(value = "机器人理解回答转人工：0不转人工，1显示转人工按钮,2直接转人工")
    private Integer robotUnderstandTransferUserMode;

    @ApiModelProperty(value = "机器人引导回答转人工：0不转人工，1显示转人工按钮,2直接转人工")
    private Integer robotGuideTransferUserMode;

    @ApiModelProperty(value = "机器人未知回答转人工：0不转人工，1显示转人工按钮,2直接转人工")
    private Integer robotUnknownTransferUserMode;

    @ApiModelProperty(value = "是否开启广告位0=否，1=是")
    private Integer infomercialMode;

    @ApiModelProperty(value = "词条评价开关 0=否，1=是")
    private Integer commentDocMode;

    @Override
    public ChatChannel convert() {
        ChatChannel info = BeanUtil.toBean(this, ChatChannel.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setChannelId(IdUtil.simpleUUID());
        info.setCreateTime(context.getNow());
        info.setUpdateTime(context.getNow());
        info.setTenantId(context.getTenantId());
        return info;
    }

}